<?php
header('content-type:text/html; charset=utf-8');
?>
<!DOCTYPE html>
<html>
<head>
<title>点餐系统编写</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8" >
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<style type="text/css">
	.navbar-brand {
	font-family: 黑体;
	}
	.panel-title {
	font-family: 黑体;
	}
</style>
</head>
<body>
<div class="navbar navbar-default">
  <div class="container">
  		<a class="navbar-brand" href="text.php">点餐系统</a>
  		<ul class="nav navbar-nav">
  				<li class="dropdown">
  						<a href="#" class="dropdown-toggle" data-toggle="dropdown" >订单管理 <span class="caret"></span></a>
  						<ul class="dropdown-menu">
  						<li><a href="orderList.php">订单列表</a></li>
  						<li><a href="orderHistoryList.php">订单记录</a></li>
  								
  										</ul>
  										</li>
  										</ul>
  										 
		<ul class="nav navbar-nav">
		<li class="dropdown">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown" >菜品管理 <span class="caret"></span></a>
		<ul class="dropdown-menu">
		<li><a href="caipinadd.php">添加菜品</a></li>
		<li><a href="dishList.php">菜品列表</a></li>
		<li class="divider"></li>
		<li><a href="dishTypeAdd.php">添加菜品类型</a></li>
		<li><a href="dishTypeList.php">菜品类型列表</a></li>
		</ul>
		</li>
		</ul>
		       
		<ul class="nav navbar-nav">
		<li class="dropdown">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown" >餐桌管理 <span class="caret"></span></a>
		<ul class="dropdown-menu">
		<li><a href="canzhuo.php">添加餐桌</a></li>
		<li><a href="CZlist.php">餐桌列表</a></li>
		</ul>
		</li>
		</ul>
		          				 
	  <ul class="nav navbar-nav">
	  		<li class="dropdown">
	  		<a href="#" class="dropdown-toggle" data-toggle="dropdown" >登录管理 <span class="caret"></span></a>
	  		<ul class="dropdown-menu">
	  		<li><a href="#" data-toggle="modal" data-target="#1">关于点餐系统</a></li>
	  		<li class="divider"></li>
	  		<li><a href="wwEdit.php">修改登录信息</a></li>
	  		<li><a href="#"  data-toggle="modal" data-target="#2">退出登录</a></li>
	  		</ul>
	  		 
		<div id="1" class="modal">
		<div class="modal-dialog">				
						<div class="modal-content">
							<div class="modal-header">
								<span class="close" data-dismiss="modal">&times;</span>
								<div class="modal-title">
									<h4>关于点餐系统</h4>
								</div>
							</div>
					<div class="modal-body">
					<h5>本点餐系统是喻德软件快训的一个程序入门Demo！仅PHP+html+css实现，不包含一句javascript代码的哦</h5>
					</div>
					<div class="modal-footer">
						<button class="btn btn-primary" data-dismiss="modal">确定</button>
					</div>
							</div>
			</div>
			</div>
			<div id="2" class="modal">
			<div class="modal-dialog">				
							<div class="modal-content">
								<div class="modal-header">
									<span class="close" data-dismiss="modal">&times;</span>
									<div class="modal-title">
										<h4>确定退出登录</h4>
									</div>
								</div>
						<div class="modal-body">
							你确定要退出登录吗？
						</div>
						<div class="modal-footer">
						<a type="submit" class="btn btn-default" href="abort.php">确定</a>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						</div>
							</div>
					</div>
				</div>
			  		</li>
			 </ul>
			  </div>
            </div>
            
	<div class="container">
	<div class="row">
			<div class="form-group col-xs-2">
			<form action="text.php">
				<div class="input-group">
					<input class="form-control" placeholder="桌号"  name="a" />
					<div class="input-group-btn">
						<button type="submit" class="btn btn-success" ><span class="glyphicon glyphicon-search"></span></button>
					</div>
				</div>
			</form>
					
			<br />
			<ul class="list-group">
					<?php
					$list=array();
					 $pdo=new PDO('mysql:dbname=ab;charset=utf8;','root');
					 @$a=$_REQUEST['a'];
					 $sqlstr='select * from c';
					 if(!empty($a)){
					 	$sqlstr=$sqlstr." where login like '%".$a."%'";
					 }
					 //echo  $sqlstr;
					 $sql=$pdo->prepare($sqlstr);
					 $sql->execute();
					 $list=$sql->fetchAll(PDO::FETCH_NAMED);
					 foreach ($list as $val){
					 	?>
					<li class="list-group-item text-center">
					<a href="text.php?id=<?php echo $val['id']?>" >
					 <?php echo $val['login'];?>
					</a>
					 </li>	
					 
					 <?php }?>
			</ul>
			</div>
		
		   	<div class="col-xs-9 col-sm-9 col-md-10">
		   		<div class="panel-group" id="pid">
		   			<div class="panel panel-success">
   					<div class="panel-heading">
   					<div class="row">
                 <div class="col-xs-2 col-sm-10">
	        		<h1 class="panel-title" style="margin-top: 5px;">
		        		<a data-toggle="collapse" href="#select">
		        		
		        		<?php 
	        			@$id=$_REQUEST['id'];
	        			$pdo=new PDO ('mysql:dbname=ab;charset=utf8','root');
	        			$sql=$pdo->prepare('select * from c where id=:id');
	        			
	        			if (!$sql->execute(array('id'=>$id)))echo "sql 执行失败";
	        			$result=$sql->fetch();
	        			if(empty($id)){?>
	        				<span class="glyphicon glyphicon-remove"></span>
		            		 <span class="hidden-xs">未选择餐桌 </span>	
	        			<?php }else{?>
	        				<span class="glyphicon glyphicon-ok"></span>
		            		 <span class="hidden-xs"><?php echo $result['login'];?>-已选餐桌  </span>	
		            		 
	        			<?php }
	        			?>
		            	 	 	                   
		            	</a>
	        		</h1>
	        	</div>     
    				            <div class="col-xs-10 col-sm-2">
    				            <a href="#" class="btn btn-success btn-sm pull-right">结账
        				        <span class="badge">0元</span> 
        				         </a>
        				         </div>
				     </div>
   					
   						
   					</div>
   					<div id="xx2" class="panel-collapse collapse">
					<div class="modal-body">
						<div class="row">
							<div class="col-sm-12 col-md-4 col-lg-3">
<!-- 							<div class="thumbnail"> -->
						
<!-- 							<span class="caption">菜品</span> -->
<!-- 							</div> -->
						
							</div>
						</div>
					</div>
					</div>
   					</div>
    					
   					<div class="panel panel-success" style="margin-top: 20px;">
   					<div class="panel-heading" >  
   					<form class="row">
   					<input type="hidden" name="selectId" value="">
   					<div class="col-sm-6 col-xs-2">
   						<h2 class="panel-title" style="margin-top: 5px;">
   							<span class="glyphicon glyphicon-th-list"></span>
   							<span class="hidden-xs">可选菜品</span>
   						</h2>
   					</div>
   					<div class="col-xs-10 col-sm-6 col-md-4 col-md-offset-2">
   						<div class="form-group" style="margin: 0;">
 							<div class=" input-group">
  				
						<input type="text" class="form-control input-sm" placeholder="菜名" name="ni" />
						<div class="input-group-btn">
						<select class="btn btn-default " name="searchId" style="font-size:11px;">
						<option >全部</option>
						<?php
					$list=array();
					 $pdo=new PDO('mysql:dbname=mk;charset=utf8;','root');
					 $sql=$pdo->prepare('select * from type');
					 $sql->execute();
					 $list=$sql->fetchAll(PDO::FETCH_NAMED);
					 foreach ($list as $val){
					 	?>
					 	<option><?php echo $val['name']?></option>
					 <?php 
					 	 
					 }
					
					?>
						</select>
						<button type="submit" class="btn btn-default btn-sm" ><span class="glyphicon glyphicon-search"></span></button>
						</div>
					
							</div>
   						</div>
   					</div>
   					<div class="clearfix"></div>
   					</form>
   						</div>
				<div class="panel-body">
					<div class="row">
					
					<?php
					$list=array();
					 $pdo=new PDO('mysql:dbname=mk;charset=utf8;','root');
					 @$ni=$_REQUEST['ni'];
					 $sqlstr='select * from picture';
					 if(!empty($ni)){
					 	$sqlstr=$sqlstr." where name like '%".$ni."%'";
					 }
					 //echo  $sqlstr;
					 $sql=$pdo->prepare($sqlstr);
					 $sql->execute();
					 $list=$sql->fetchAll(PDO::FETCH_NAMED);
					 foreach ($list as $val){
					 	?>
						<div class="col-sm-12 col-md-4 col-lg-3">
						<div class="thumbnail" style="height: 220px">
							<img alt="<?php echo $val['name'] ?>" src="<?php echo $val['img'] ;?>">
							<div class="caption text-center">
							<button class="btn btn-link btn-block"><?php echo $val['name']?>　<?php echo $val ['prize']?>元</button>
							</div>                    
				
					</div>
						</div>
					 <?php 
					 }			
					?>
   					</div>
   				</div>
			</div>
		</div>
		</div>
	</div>
</div>
</body>
</html>